import os
from launch import LaunchDescription
from launch_ros.actions import Node
from ament_index_python.packages import get_package_share_directory
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource

def generate_launch_description():

    '''
        配置文件声明
    '''
    cam_config = os.path.join(
        get_package_share_directory('cam_onvif_driver'),
        'config',  # 配置文件所在目录
        'cam_config.yaml'
    )

    #   机器视觉
    vision_driver = Node(
        package='cam_onvif_driver',  
        executable='cam_driver',     
        name='cam_driver',    
        output='screen' ,
        parameters=[cam_config]
    )


    '''''''''''''''''''''''''''''''''''
    返回启动列表
    
    '''
    return LaunchDescription([
        vision_driver
    ])